import TextMessage from '/@/views/chat/components/message/TextMessage.vue'
import FileMessage from '/@/views/chat/components/message/FileMessage.vue'
import CodeMessage from '/@/views/chat/components/message/CodeMessage.vue'
import VoteMessage from '/@/views/chat/components/message/VoteMessage.vue'
import LoginMessage from '/@/views/chat/components/message/LoginMessage.vue'
import ImageMessage from '/@/views/chat/components/message/ImageMessage.vue'
import AudioMessage from '/@/views/chat/components/message/AudioMessage.vue'
import VideoMessage from '/@/views/chat/components/message/VideoMessage.vue'
import InviteMessage from '/@/views/chat/components/message/InviteMessage.vue'
import RevokeMessage from '/@/views/chat/components/message/RevokeMessage.vue'
import ForwardMessage from '/@/views/chat/components/message/ForwardMessage.vue'
import SystemTextMessage from '/@/views/chat/components/message/SystemTextMessage.vue'
import ShopMessage from '/@/views/chat/components/message/ShopMessage.vue'
import OrderMessage from '/@/views/chat/components/message/OrderMessage.vue'
import CommentMessage from '/@/views/chat/components/message/CommentMessage.vue'
import PayMessage from '/@/views/chat/components/message/PayMessage.vue'

import UserCardDetail from '/@/views/chat/components/user/UserCardDetail.vue'
import UserContacts from '/@/views/chat/components/user/UserContacts.vue'

const components = [
    TextMessage,
    FileMessage,
    CodeMessage,
    VoteMessage,
    LoginMessage,
    VideoMessage,
    AudioMessage,
    ImageMessage,
    InviteMessage,
    RevokeMessage,
    ForwardMessage,
    SystemTextMessage,
    UserCardDetail,
    UserContacts,
    ShopMessage,
    OrderMessage,
    CommentMessage,
    PayMessage
]

export default {
    install: app => {
        components.forEach(component => {
            // 在app上进行扩展，app提供 component directive 函数
            // 如果要挂载原型 app.config.globalProperties 方式
            app.component(component.name, component);
        });
    }
}